<?php while (have_posts()) : the_post(); ?>
	
	<div class="post" id="<?php the_ID() ?>">
		<div class="row">
			<div class="eightcol last">
				<h1><?php the_title() ?></h1>
				<h2 id="credit"><?php display_credit() ?></h2>
			</div>
		</div>
		<div class="row">
			<div class="eightcol">
				<div id="content">
					<?php
						$custom_fields = get_post_custom();
	
						if ($custom_fields[rating])
							display_rating();
							
						the_content();
					?>
				</div>
				<div id="comments">
					<?php comments_template() ?>
				</div>
			</div>
			<div class="fourcol last" id="sidebar">
				<div id="cd_info">
					<?php
						$album = new album(get_the_title());
						
						$album->render();
					?>
				</div>
				<div id="artist_info">
					<?php
						$artist = new artist($album->artist);
						
						$artist->render();
					?>
				</div>
			</div>
		</div>
	</div>

	<?php if (!($custom_fields[rating])) : ?>
	<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/js/convert_rating.js"></script>
	<?php else: ?>
	<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/js/remove_rating.js"></script>
	<?php endif; ?>
	<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/js/highlight_recommended.js"></script>
	<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/js/fetch_grooveshark.js"></script>
	<script type="text/javascript" src="<?php bloginfo('template_directory') ?>/js/fetch_spotify.js"></script>
	
<?php endwhile; ?>